﻿<%@ Page Title="幻灯片管理" Language="C#" MasterPageFile="~/Masters/Account.Master" AutoEventWireup="true"
    CodeBehind="BannerList.aspx.cs" Inherits="LEARNREN.COM.WebSite.Administrator.BannerList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="commonContent">
        <p id="msg" runat="server" visible="false" class="failureNotification">
        </p>
        <fieldset class="changePassword">
            <legend>所有Banner</legend>
            <asp:GridView ID="gvBanners" runat="server" AllowPaging="True" AllowSorting="True"
                AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966" BorderStyle="None"
                BorderWidth="1px" CellPadding="4" CssClass="gridViewClass" OnPageIndexChanging="gvBanners_PageIndexChanging"
                PageSize="5" OnRowDeleting="gvBanners_RowDeleting" DataKeyNames="Id" EmptyDataText="没有Banner信息。">
                <Columns>
                    <asp:HyperLinkField DataNavigateUrlFields="Image" DataTextField="Title" HeaderText="图片"
                        Target="_blank" />
                    <asp:HyperLinkField DataNavigateUrlFields="Link" DataTextField="Link" HeaderText="链接地址"
                        Target="_blank" />
                    <asp:BoundField DataField="Order" HeaderText="排序" />
                    <asp:TemplateField HeaderText="编辑">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButtonEdit" runat="server" CommandArgument='<%# Eval("Id") %>'
                                Text="编辑" OnClick="LinkButtonEdit_Click"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:CommandField DeleteText="&lt;div id=&quot;de&quot; onclick=&quot;javascript:return confirm('确认删除吗？')&quot;&gt;删除&lt;/div&gt;"
                        HeaderText="删除" ShowDeleteButton="True" />
                </Columns>
                <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
                <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
                <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
                <RowStyle BackColor="White" ForeColor="#330099" />
                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
                <SortedAscendingCellStyle BackColor="#FEFCEB" />
                <SortedAscendingHeaderStyle BackColor="#AF0101" />
                <SortedDescendingCellStyle BackColor="#F6F0C0" />
                <SortedDescendingHeaderStyle BackColor="#7E0000" />
            </asp:GridView>
        </fieldset>
        <fieldset class="changePassword">
            <legend>Banner编辑</legend>
            <p>
                <asp:HiddenField runat="server" ID="txtId" />
                <asp:Label ID="BannerTitleLabel" runat="server" AssociatedControlID="BannerTitle">标题:</asp:Label>
                <asp:TextBox ID="BannerTitle" runat="server" CssClass="textEntry"></asp:TextBox>
                <asp:RequiredFieldValidator ID="BannerTitleRequired" runat="server" ControlToValidate="BannerTitle"
                    CssClass="failureNotification" ErrorMessage="必须填写“标题”。" ToolTip="必须填写“标题”。" ValidationGroup="BannerValidationGroup">*</asp:RequiredFieldValidator>
            </p>
            <p>
                <asp:Label ID="BannerLinkLable" runat="server" AssociatedControlID="BannerLink">链接地址:</asp:Label>
                <asp:TextBox ID="BannerLink" runat="server" CssClass="textEntry"></asp:TextBox>
            </p>
            <p>
                <asp:Label ID="BannerImageLable" runat="server" AssociatedControlID="BannerImage">图片地址:</asp:Label>
                <asp:FileUpload ID="BannerImage" runat="server" CssClass="textEntry" />
                <asp:Label ID="lblMsg" runat="server" Text="Label" ForeColor="Red" Visible="false">不修改请不要选择文件</asp:Label>
                <asp:RequiredFieldValidator ID="BannerImageRequiredFieldValidator" runat="server"
                    ControlToValidate="BannerImage" CssClass="failureNotification" ErrorMessage="必须选择图片。"
                    ToolTip="必须选择图片。" ValidationGroup="BannerValidationGroup">*</asp:RequiredFieldValidator>
            </p>
            <p>
                <asp:Label ID="BannerOrderLabel" runat="server" AssociatedControlID="BannerOrder">显示顺序:</asp:Label>
                <asp:TextBox ID="BannerOrder" runat="server" CssClass="textEntry"></asp:TextBox>
                <asp:RequiredFieldValidator ID="BannerOrderRequiredFieldValidator" runat="server"
                    ControlToValidate="BannerOrder" CssClass="failureNotification" ErrorMessage="必须填写“显示顺序”。"
                    ToolTip="必须填写“显示顺序”。" ValidationGroup="BannerValidationGroup">*</asp:RequiredFieldValidator>
                <asp:RangeValidator ID="BannerOrderRangeValidator" runat="server" ControlToValidate="BannerOrder"
                    ErrorMessage="只能填写数字。" ToolTip="只能填写数字。" Type="Integer" MaximumValue="1000000"
                    MinimumValue="0" CssClass="failureNotification" ValidationGroup="BannerValidationGroup">*</asp:RangeValidator>
            </p>
        </fieldset>
        <p class="submitButton">
            <span style="float:left;">
                <asp:Button runat="server" ID="btnReCreate" Text="刷新Banner动画" 
                onclick="btnReCreate_Click" /></span>
            <asp:Button ID="CancelPushButton" runat="server" CausesValidation="False" CommandName="Cancel"
                Text="取消" />
            <asp:Button ID="SavePushButton" runat="server" CommandName="ChangePassword" Text="保存"
                ValidationGroup="BannerValidationGroup" OnClick="SavePushButton_Click" />
        </p>
    </div>
</asp:Content>
